<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<%@ include file="/commons/commonEdit.jsp"%>
<%@ include file="/commons/validation.jsp"%>
<%@ include file="/commons/fileUpload.jsp" %>
<html>
<script type="text/javascript">
  function submitForm(){

      var isTrue=$("houseForm").fireEvent("onSubmit");
      if(isTrue)
      {
         var tempPropertyType="";
  		 var propertyType=document.getElementsByName("propertyType");
   		  for (var   i=0;   i<propertyType.length;   i++)
   		  {
               if(propertyType[i].checked)
                  tempPropertyType=tempPropertyType+propertyType[i].value+",";
     	  }
      document.getElementById("directionId").value=tempPropertyType;
      document.getElementById("houseForm").submit();
      }
  }

  function init(){

		//朝向
		var str = "${flat.directionId}";
		var propertyType=document.getElementsByName("propertyType");
  		for (var   i=0;   i<propertyType.length;   i++)
  		{
           if(str.indexOf(propertyType[i].value,0)>-1)
           {
            	propertyType[i].checked = true;
           }
        }

	}





</script>



<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td class="window_head_outBg"><table border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td><img src="${ctx}/images/ico_Advance.gif" width="16" height="16" align="absmiddle"> <span class="window_head_intext">${key.edit_room}</span></td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td class="aux_header_line_1"></td>
  </tr>
  <tr>
    <td class="aux_header_line_2"></td>
  </tr>
  <tr>
    <td valign="middle" class="content"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="container_in_show">
      <tr>
        <td valign="top"><div id="tab_Search" >
              <table width="100%" border="0" cellpadding="0" cellspacing="0" id="tab_subMenu1">
              <form id="houseForm" name="houseForm" method="post" action="${ctx}/house_houseAction.do?method=updateHouse" class="required-validate" ENCTYPE="multipart/form-data">
              <input type="hidden" name="buildingId" value="${buildingId}"/>
              <input type="hidden" name="keyword" value="${flat.keyword}">
              <input type="hidden" name="projectId" value="${flat.projectId}">

              <input type="hidden" name="directionId" value=""/>
                <tr>
                  <td><table width="100%" border="0" align="center" cellpadding="5" cellspacing="0">
                      <tr>
                        <td><table width="100%" border="0" cellpadding="0" cellspacing="1" class="aux_intable_color">
                          <tr>
                            <td class="aux_intable_td1">${key.unit}</td>
                            <c:if test="${houseGrpList=='[]'|| houseGrpList==null}">
                            <td class="aux_intable_td2">
	                            <input type="hidden" name="houseGrpid" value="${flat.houseGrpid}">
	                            </td>
                            </c:if>
	                        <c:if test ="${houseGrpList !='[]'&& houseGrpList!=null}">
	                        <c:if test ="${canAllowModify eq '0'}">
	                            <td class="aux_intable_require" id="aux_intable_houseGrpid">
	                          <pms:unitedSelect id="houseGrpid"
	                                           selectText="${key.please_select}"
												name="houseGrpid"
												dataList="${houseGrpList}"
												optionLabel="name"
												className="select-one-required"
												value="${flat.houseGrpid}"
												optionValue="keyword" >
								</pms:unitedSelect>

	                          </c:if>
	                            <c:if test ="${canAllowModify eq '1'}">
	                            <td class="aux_intable_td2">
	                            ${flat.houseGrpName}
	                             <input type="hidden" name="houseGrpid" value="${flat.houseGrpid}">
	                            </c:if>



								</td>
                            </c:if>
                            <td valign="top" class="aux_intable_td1">${key.construction_area}</td>
                            <td valign="top" class="aux_intable_td2">${flat.buildSize}
                              ㎡</td>
                          </tr>
                          <tr>
                            <td class="aux_intable_td1">${key.floor}</td>
                            <c:if test="${canAllowModify eq '0'}">
	                            <td class="aux_intable_require">
	                            <pms:unitedSelect id="floor"
	                                            selectText="${key.please_select}"
												name="floor"
												dataList="${houseFloorList}"
												value="${flat.floor}"
												className="select-one-required" >

											</pms:unitedSelect>
	                            </td>
                            </c:if>
                            <c:if test ="${canAllowModify eq '1'}">
	                            <td class="aux_intable_td2">
									${flat.floor}
									<input type="hidden" name="floor" value="${flat.floor}">
	                            </td>
                            </c:if>
                            <td valign="top" class="aux_intable_td1">${key.inner_area}</td>
                            <td valign="top" class="aux_intable_td2">${flat.innerSize}
                              ㎡</span></td>
                          </tr>
                          <tr>
                            <td valign="top" class="aux_intable_td1">${key.houseNumber}</td>
                            <c:if test="${canAllowModify eq '0'}">
	                            <td valign="top" class="aux_intable_require">
	                            <input name="houseNumber" type="text" maxLength="36" class="required validate-char validate-ajax" relativeId="projectId,keyword" validateUrl="${ctx}/house_houseAction.do?method=validationHouseNumberEdit" value="${flat.houseNumber}" size="16">
	                            </td>
							</c:if>
							<c:if test="${canAllowModify eq '1'}">
							    <td valign="top" class="aux_intable_td2">
	                              ${flat.houseNumber}
	                              <input type="hidden" name="houseNumber" maxLength="36" value="${flat.houseNumber}">
	                            </td>
							</c:if>
                            <td valign="top" class="aux_intable_td1">${key.pool_area}</td>
                            <td valign="top" class="aux_intable_td2">${flat.publicSize}
                              ㎡</td>
                          </tr>
                          <tr>
                            <td valign="top" class="aux_intable_td1">${key.apartment}</td>
                            <c:if test="${canAllowModify eq '0'}">
	                            <td valign="top" class="aux_intable_require">
	                            <pms:unitedSelect id="housePlanId"
	                                              selectText="${key.please_select}"
												name="housePlanId"
												dataList="${housePlanList}"
												value="${flat.housePlanId}"
												optionLabel="name"
												className="select-one-required"
												optionValue="keyword" >
								</pms:unitedSelect>
	                            </td>
                            </c:if>
                            <c:if test="${canAllowModify eq '1'}">
                            	<td valign="top" class="aux_intable_td2">
												${flat.housePlanName}
								<input type="hidden" name="housePlanId" value="${flat.housePlanId}">
	                            </td>
                            </c:if>
                            <td rowspan="2" valign="top" class="aux_intable_td1">${key.towards}</td>
                            <td rowspan="2" valign="top" class="aux_intable_td2">
                            <logic:iterate id="direction" name="directionList">
                              <input type="checkbox" name="propertyType" value="${direction.id}">
                              <bean:write name="direction" property="name"/>&nbsp;&nbsp;
			                </logic:iterate>
						</td>
                          </tr>
                          <tr>
                            <td valign="top" class="aux_intable_td1">${key.jiaofang_standards}</td>
                            <c:if test="${canAllowModify eq '0'}">
	                            <td valign="center" class="aux_intable_require">
	                            <pms:unitedSelect id="deliveryLimitationId"
	                                              selectText="${key.please_select}"
												name="deliveryLimitationId"
												dataList="${deliveryLimitationList}"
												optionLabel="name"
												value="${flat.deliveryLimitationId}"
												className="select-one-required"
												optionValue="id" >
								</pms:unitedSelect>
	                            </td>
	                         </c:if>
	                         <c:if test="${canAllowModify eq '1'}">
	                            <td valign="center" class="aux_intable_td2">
								${flat.deliveryLimitationName}
								<input type="hidden" name="deliveryLimitationId" value="${flat.deliveryLimitationId}">
	                            </td>
	                         </c:if>
                            </tr>
                          <tr>
                            <td valign="top" class="aux_intable_td1">${key.housing_floor_plan}</td>
                            <td valign="center" class="aux_intable_td2">
                            <mypms:ImageUpload name="picpath1"  maxNum="1" data="${flat.ichnographyVo}" imageType="jpg,JPG,gif,GIF" postfixName="Ichnograp">
				              </mypms:ImageUpload>

                			</td>
                            <td rowspan="2" valign="top" class="aux_intable_td1">${key.Remarks}</td>
                            <td rowspan="2" valign="top" class="aux_intable_td2"><textarea name="remark" cols="25" rows="4" class="max-length-500">${flat.remark}</textarea></td>
                          </tr>
                          <tr>
                            <td valign="top" class="aux_intable_td1">${key.distribution_of_pipeline}</td>
                            <td valign="top" class="aux_intable_td2">
                            <mypms:ImageUpload name="picpath2"  maxNum="1" data="${flat.pipelineVo}" imageType="jpg,JPG,gif,GIF" postfixName="Pipeline">
				              </mypms:ImageUpload>
					        </td>
                          </tr>
                        </table></td>
                      </tr>

                  </table></td>
                </tr></form>

              </table>

             </div>

             </td>
        </tr>
       </table>
	      </td>
  </tr>
  <tr>
    <td class="window_footer"><table border="0" align="right" cellpadding="0" cellspacing="0">
        <tr>
          <td><table border="0" cellpadding="0" cellspacing="0">

          </table></td>
		  <td class="btn_between_space"></td>
          <td><table border="0" cellpadding="0" cellspacing="0" >
            <tr>
              <td class="buttonOffLeft" id="btn1_51"></td>
              <td class="buttonOffMiddle" id="btn1_52" onblur="btn_change(5)" onMouseOver="btn_change_over(5)" onMouseOut="btn_change_out(5)" onClick="submitForm();"><img src="${ctx}/images/ico_ok.gif" border="0" align="absmiddle" />${key.save}</td>
              <td class="buttonOffRight" id="btn1_53"></td>
            </tr>
        </table></td>
        <td class="btn_between_space"></td>
        <td><table border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td class="buttonOffLeft" id="btn1_31"></td>
              <td class="buttonOffMiddle" id="btn1_32" onblur="btn_change(3)"  onClick="windowClose();" onMouseOver="btn_change_over(3)" onMouseOut="btn_change_out(3)"><img src="${ctx}/images/ico_cancel.gif" border="0" align="absmiddle" />${key.close}</td>
              <td class="buttonOffRight" id="btn1_33"></td>
            </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>

</table>

</body>
<script type="text/javascript">
init();
</script>

</html>